<%-- 
    Document   : content_myshop
    Created on : Jan 7, 2012, 1:40:42 PM
    Author     : PHT
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<div class="main_content_panel" id="box_listproduct">
    <p class="top_main_content_panel">
        Gian hàng của ${sessionScope.taiKhoan.tenTaiKhoan}
    </p>
    <div class="content_main_content_panel">
        <c:if test="${numberPages > 0}">
            <div class="paging">
                <ul>
                    <c:forEach begin="1" end="${numberPages}" var="i">
                        <c:url value="myshop.do" var="myshop_link">
                            <c:param name="page" value="${i}" />
                        </c:url>
                        <c:if test="${requestScope.page eq i}">
                            <li class="current_page">    
                                <a href="<c:out value="${myshop_link}" />">${i}</a>
                            </li>
                        </c:if>
                        <c:if test="${requestScope.page ne i}">
                            <li>    
                                <a href="<c:out value="${myshop_link}" />">${i}</a>
                            </li>
                        </c:if>
                    </c:forEach>
                </ul>                           
            </div>

            <div class="list_products">
                <c:forEach var="sp" items="${dsSP}">
                    <div class="product_item">
                       <c:url value="product.do" var="linkDetailPro">
                            <c:param name="masp" value="${sp.maSanPham}"></c:param>
                        </c:url>
                        <p class="name_product">    
                            <a href="/DauGia/${linkDetailPro}" title="Xem chi tiết">
                                ${sp.tenSanPham}
                            </a>                                
                        </p>
                        <p class="image_product">
                            <a href="/DauGia/${linkDetailPro}" title="Xem chi tiết">
                                <img src="/DauGia/${sp.hinhMoTa}" alt="${sp.tenSanPham}" width="110px" height="110px" />
                            </a>
                        </p>
                        <div class="info_product">
                            <p class="timedown_product" id="countdown_${sp.maSanPham}">
                                <fmt:formatDate value="${sp.ngayDang}" pattern="dd/MM/yyyy HH:mm"></fmt:formatDate>
                            </p>
                            <p class="timeend_product">
                                <fmt:formatDate value="${sp.ngayHetHan}" pattern="dd/MM/yyyy HH:mm:ss"></fmt:formatDate>
                            </p>
                            <p class="price_product">
                                <fmt:formatNumber pattern="###,###" value="${sp.giaHienTai}"></fmt:formatNumber><span>đ</span>
                            </p>
                            <fmt:formatDate pattern="MM/dd/yyyy HH:mm:ss" value="${sp.ngayHetHan}" var="dateEnd"></fmt:formatDate>
                        </div>                                
                        <p class="datgia">
                            <a href="#"> <img src="/DauGia/images/btn_datgia.png" alt="" /></a>
                        </p>
                        <fmt:formatDate pattern="MM/dd/yyyy HH:mm:ss" value="${sp.ngayHetHan}" var="dateEnd"></fmt:formatDate>
                    </div>
                    <script type="text/javascript"> 
                        GetCount(new Date('${dateEnd}'), 'countdown_${sp.maSanPham}' );
                    </script>
                </c:forEach>
            </div>
        </c:if>

        <c:if test="${numberPages < 1}">
            <p class="message_empty"> Gian hàng này hiện chưa có sản phẩm !</p>
        </c:if>
    </div>
</div>